package cn.gemiman.daoyi.module.iot.controller.admin.kafkamsglogs.vo;

import cn.gemiman.daoyi.framework.excel.core.annotations.DictFormat;
import cn.gemiman.daoyi.framework.excel.core.convert.DictConvert;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

@Schema(description = "管理后台 - kafka原始消息 Response VO")
@Data
@ExcelIgnoreUnannotated
public class KafkaMsgLogsRespVO {

    @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "29593")
    @ExcelProperty("编号")
    private Long id;

    @Schema(description = "主题")
    @ExcelProperty("主题")
    private String topics;

    @Schema(description = "生产者")
    @ExcelProperty("生产者")
    private String bootstrapServers;

    @Schema(description = "消费者", example = "20994")
    @ExcelProperty("消费者")
    private String consumerGroupId;

    @Schema(description = "原始消息")
    @ExcelProperty("原始消息")
    private String msg;

    @Schema(description = "是否已读", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty(value = "是否已读", converter = DictConvert.class)
    @DictFormat("infra_boolean_string") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Boolean viewed;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;

    @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("更新时间")
    private LocalDateTime updateTime;

}
